package com.kaiwukj.android.ufamily.mvp.http.api.service;

import com.kaiwukj.android.ufamily.mvp.http.entity.base.BaseListResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.base.BaseObjResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.ActiveResult;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ActiveService {

    /**
     * 首页热门活动
     *
     * @param count 获取数量
     * @param type  1:院子里 2：同城
     * @return List<ActiveResult>
     */
    @GET("/social/app/activityDetail/listHotActive")
    Observable<BaseObjResp<List<ActiveResult>>> fetchActiveHot(@Query("num") int count,
                                                               @Query("type") int type);

    @GET("/social/app/activityDetail/page")
    Observable<BaseListResp<ActiveResult>> fetchActiveList(@Query("page") Integer page,
                                                           @Query("pageSize") Integer pageSize,
                                                           @Query("publisherType") Integer pubType,
                                                           @Query("status") Integer status,
                                                           @Query("type") Integer type);

    @GET("/social/app/activityDetail/getActivityDetail/{id}")
    Observable<BaseObjResp<ActiveResult>> getActiveById(@Path("id") int id);

    @POST("/social/app/userActivity/addUserActivity")
    Observable<BaseObjResp<Void>> joinActive(@Body RequestBody body);

    @GET("/social/app/userActivity/cancelReport/{id}")
    Observable<BaseObjResp<Void>> cancelJoin(@Path("id") int id);

    @GET("/social/app/userActivity/page")
    Observable<BaseListResp<ActiveResult>> fetchMyActive(@Query("page") Integer page,
                                                         @Query("pageSize") Integer pageSize,
                                                         @Query("status") Integer status);

}
